<?php
Namespace Cyfy;

/**
 * Main file.
 * 
 * Main file, through which are all web pages shown.
 *
 * @author Dandelion <dandelion8888@gmail.com>
 * @package cyfy
 *
 */

// Includes basic definitions, loads modules ...
include_once("_start.php");

// query
\Cyfy\Cyfy :: $realQuery = \Cyfy\Cyfy :: $query;

// Loading settings for the active template
Template :: load(\Cyfy\Cyfy :: $template);

// settings for JavaScript
$js = '
Cyfy.pathPrefix = "' . \Cyfy\Cyfy ::  $pathPrefix . '"
Cyfy.multiLanguage = "' . \Cyfy\Language :: $multilanguage . '"
Cyfy.language = "' . \Cyfy\Language :: getActive() . '"
Cyfy.query = "' . \Cyfy\Cyfy ::  $query . '"
';
\Cyfy\Cyfy ::  javaScript($js, "inline", "header");

// Checks, whether any form hasn't been sent.
\Cyfy\Modules\Forms\Module :: checkForms();

// Adding some JS files into the header
\Cyfy\Cyfy ::  javaScript(\Cyfy\Cyfy :: getSourcePath("scripts/url.js"), "file");
\Cyfy\Cyfy ::  javaScript(\Cyfy\Cyfy :: getSourcePath("scripts/messages.js"), "file");
\Cyfy\Cyfy ::  javaScript(\Cyfy\Cyfy ::  getSourcePath("scripts/blocks.js"), "file");

// Builds the page
\Cyfy\Template :: build();

// Ends the script
include("_end.php");


